BEGIN;


DROP FUNCTION IF EXISTS authenticateClient(varchar, varchar);
DROP FUNCTION IF EXISTS getUserById(integer);
DROP FUNCTION IF EXISTS getSessionById(varchar);
DROP FUNCTION IF EXISTS deleteSessionById(varchar);
DROP FUNCTION IF EXISTS createSession(varchar, varchar, integer);
DROP FUNCTION IF EXISTS deleteExpiredSession(integer);
DROP FUNCTION IF EXISTS resetSession(varchar, varchar);

DROP INDEX IF EXISTS username_idx;
DROP INDEX IF EXISTS id_idx;
DROP INDEX IF EXISTS expires_idx;

-- partner_user
DROP table partner_user CASCADE;
DROP SEQUENCE partner_user_id_seq;

-- sessions
DROP table sessions CASCADE;


COMMIT;
